import { createSlice, PayloadAction } from "@reduxjs/toolkit";

//const collapsed = localStorage.getItem("collapsed")

const appSlic = createSlice({
    name: "app",
    initialState: {
        collapsed: false,
    },
    reducers: {
        setCollapsed(state, action: PayloadAction<boolean>) {
            state.collapsed = action.payload

            // if (action.payload) {
            //     localStorage.setItem("collapsed", "true");
            // } else {
            //     localStorage.removeItem("collapsed");
            // }

        },
    },
});


export const { setCollapsed } = appSlic.actions;

export default appSlic.reducer;